﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="listcategory.aspx.cs" Inherits="AdventureWorksWebApp.listcategory" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="header">
        <h2>Kategorie produktów</h2>
    </div>
    <div id="details">
 <asp:Label ID="lblCategory" runat="server" Text="Category: " CssClass="details_labels" />
        <asp:DropDownList ID="ddCategory" runat="server" CssClass="details_text" OnSelectedIndexChanged="ddCategory_SelectedIndexChanged"
            AutoPostBack="true">
        </asp:DropDownList>
        <asp:LinkButton ID="lnkAddCategory" runat="server" Text="Dodaj kategorię"  CssClass="link" />
        <asp:Label ID="lblSubcategory" runat="server" Text="Subcategory: " CssClass="details_labels" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Panel ID="Panel2" runat="server">
                    <asp:DropDownList ID="ddSubcategory" runat="server" CssClass="details_text">
                    </asp:DropDownList>
                    
                </asp:Panel>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ddCategory" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:LinkButton ID="lnkAddSubCategory" runat="server" Text="Dodaj podkategorię"  CssClass="link" />
        </div>
         <div id="buttons">
        <asp:LinkButton ID="lnkBack" runat="server" Text="Powrót do menu" PostBackUrl="~/index.aspx"
            CssClass="button" />
    </div>
    <asp:Panel ID="Panel1" runat="server" BackColor="White" CssClass="messagebox">
        <div class="center">
            <asp:Label ID="Label1" runat="server" Text="Wprowadź nazwę kategorii:"   CssClass="message"></asp:Label>
                <br />
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                 <br />
            <asp:LinkButton ID="LinkButton1" runat="server" Text="Dodaj" CssClass="buttonmain" 
                onclick="LinkButton1_Click"/>
            <asp:LinkButton ID="LinkButton2" runat="server" Text="Anuluj" CssClass="buttonmain" />
        </div>
        
    </asp:Panel>
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="LinkButton2"
        PopupControlID="Panel1" TargetControlID="lnkAddCategory" BackgroundCssClass="background">
    </asp:ModalPopupExtender>

     <asp:Panel ID="Panel3" runat="server" BackColor="White" CssClass="messagebox">
        <div class="center">
            <asp:Label ID="Label2" runat="server" Text="Wprowadź nazwę podkategorii:"   CssClass="message"></asp:Label>
                <br />
                 <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                  <br />
            <asp:LinkButton ID="LinkButton3" runat="server" Text="Dodaj" CssClass="buttonmain" 
                onclick="LinkButton3_Click"/>
            <asp:LinkButton ID="LinkButton4" runat="server" Text="Anuluj" CssClass="buttonmain" />
        </div>
       
    </asp:Panel>
    <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" CancelControlID="LinkButton4"
        PopupControlID="Panel3" TargetControlID="lnkAddSubCategory" BackgroundCssClass="background">
    </asp:ModalPopupExtender>

</asp:Content>
